import request from '@/utils/request'
import { requestPath } from '@/utils/global.js'

export function saveReview(data) { //添加评论
    return request({
        url: `${requestPath.resource}/comment/save`,
        method: 'post',
        data
    })
}

export function getReview(params) { //获取评论列表
    return request({
        url: `${requestPath.sysuser1}/comment/page`,
        method: 'get',
        params
    })
}

export function agreeReview(data) { //点赞
    return request({
        url: `${requestPath.sysuser1}/comment/agree?commentId=` + data,
        method: 'post'
    })
}

export function reviewDetails(params) { //帖子评论详情
    return request({
        url: `${requestPath.sysuser1}/comment/get/${params}`,
        method: 'get',
    })
}

export function replySave(data) { //帖子添加回复
    return request({
        url: `${requestPath.sysuser1}/comment/save`,
        method: 'post',
        data
    })
}

export function forumReviewDet(params) { // 发帖评论回复
    return request({
        url: `${requestPath.sysuser1}/forum/get`,
        method: 'get',
        params
    })
}


export function reviewCourseDetails(params) { //课程评论详情
    return request({
        url: `${requestPath.sysuser}/comment/get/${params}`,
        method: 'get'
    })
}

// agreeReview: (data) => request('POST', `${app.sysuser1}/comment/agree?commentId=`+data), //点赞